#include "SQLStatementImpl.h"
#include <assert.h>
#include <stdio.h>

#include "../SQLUtils.h"
#include "SQLObject.h"
#include "../../Exception/UnsupportedOperationException.h"
#include "../../utils/log.h"

SQLStatementImpl::SQLStatementImpl()
{
  headHints = std::make_shared<std::list<SQLCommentHint_ptr>>();
}

SQLStatementImpl::~SQLStatementImpl()
{
}
string_ptr SQLStatementImpl::toString()
{
  make_string_ptr("");
}

void SQLStatementImpl::accept0(SQLASTVisitor_ptr visitor)
{
  LOG_INFO << "goto UnsupportedOperationException";
  throw new UnsupportedOperationException(this->getClass());
}

SQLStatementImpl::SQLStatementImpl(DbType_ptr dbType)
{
  headHints = std::make_shared<std::list<SQLCommentHint_ptr>>();
  this->dbType = dbType;
}

DbType_ptr SQLStatementImpl::getDbType()
{
  return dbType;
}

void SQLStatementImpl::setDbType(DbType_ptr dbType)
{
  this->dbType = dbType;
}

string_ptr SQLStatementImpl::toString(VisitorFeature_list_ptr features)
{
  // SQLObject_ptr  tmp = static_cast<SQLObject_ptr >(this);
  string_ptr tmp = SQLUtils::toSQLString(SharedObject(SQLStatementImpl), dbType, NULL, features);
  return (tmp);
}
